package me.zhengjie.modules.system.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

@Getter
@AllArgsConstructor
public enum ChannelEnum {

    ZF("ZF", "中付"),
    QBL("QBL", "钱宝"),
    ;
    @JsonValue
    @EnumValue
    private final String code;
    private final String name;

    public static ChannelEnum findOne(String code) {
        return Arrays.stream(ChannelEnum.values())
                .filter(type -> type.getCode().equals(code)).findAny().orElse(null);
    }
}

